import Vue from 'vue'
import router from './router/index'
import ElementUI from 'element-ui' // 新添加
import 'element-ui/lib/theme-chalk/index.css' // 新添加，避免后期打包样式不同，要放在import
import App from './App.vue'
import globalConstant from '../common/global-constant'
import globalMethod from '../common/global-method'
import store from './store'
import ipcRequest from '../common/ipcRequest'
//自定义全局组件
import sqlData from './components/combination/sql-data'

// vue  配置
Vue.config.productionTip = false
Vue.config.devtools = true

// 全局引用模块
Vue.use(ElementUI)

const components = [
  sqlData
]
components.forEach(component => {
  Vue.component(component.name, component);
});
// 设置全局变量
Vue.prototype.$global = globalMethod.mergeObject(globalConstant, globalMethod)
Vue.prototype.$ipcRequest = ipcRequest

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))

/* eslint-disable no-new */
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
